<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Fermierul.md',
	
	'theme'=>'fermierul',
    
        'sourceLanguage'=>'en',
	'language'=>'ro',
    
        'behaviors'=>array(
            'onBeginRequest' => array(
                'class' => 'application.components.behaviors.BeginRequest'
            ),
        ),
    
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
                'application.modules.user.models.*',
                'application.modules.user.components.*',
                'application.modules.rights.*',
                'application.modules.rights.components.*',
                'application.modules.image.components.*',
                'application.modules.image.models.Image',
	),
	
	'aliases' => array(
                'helpers' => 'application.widgets',
                'widgets' => 'application.widgets',
	),
	
	'defaultController'=>'site',

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'secret1',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
                'user',
                'rights'=>array(
                        //'install'=>true,
                ),
                'image'=>array(
                        'createOnDemand'=>true, // requires apache mod_rewrite enabled
                        'install'=>true, // allows you to run the installer
                ),
	),

	// application components
	'components'=>array(
                /*
                'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
                */
                'user'=>array(
                        'class'=>'RWebUser',
                        // enable cookie-based authentication
                        'allowAutoLogin'=>true,
                        'loginUrl' => array('/user/login'),
                ),
            
                'authManager'=>array(
                        'class'=>'RDbAuthManager',
                        'connectionID'=>'db',
                        'defaultRoles'=>array('Authenticated', 'Guest'),
                ),
                
		// uncomment the following to enable URLs in path-format
		
		'urlManager'=>array(
                        'class'=>'application.components.UrlManager',
                        'urlFormat'=>'path',
                        'showScriptName'=>false,
                        'rules'=>array(
                                
                                '<lang:(ro|ru|en)>'=>'/site/index',
                                '/<lang:(ro|ru|en)>/post/<id:\d+>-<title:.*?>.html'=>'/post/view',
                                '/<lang:(ro|ru|en)>/posts/<tag:.*?>'=>'/post/index',
                                '/<lang:(ro|ru|en)>/articles'=>'/post/index',
                                '/<lang:(ro|ru|en)>/news'=>'/post/news',
                                '/<lang:(ro|ru|en)>/<action:(contact)>' => '/site/<action>',
                                '/<lang:(ro|ru|en)>/<view:(about|terms)>' => array('/site/page', 'view'=>'<view>'),
                                '/<lang:(ro|ru|en)>/<controller:\w+>/<action:\w+>'=>'/<controller>/<action>',
                                '/<lang:(ro|ru|en)>/<module:\w+>/<controller:\w+>/<action:\w+>'=>'/<module>/<controller>/<action>',
                            
                                ''=>'/site/index',
                                '/post/<id:\d+>-<title:.*?>.html'=>'/post/view',
                                '/posts/<tag:.*?>'=>'/post/index',
                                '/articles'=>'/post/index',
                                '/news'=>'/post/news',
                                '/<action:(contact)>' => '/site/<action>',
                                '/<view:(about|terms)>' => array('/site/page', 'view'=>'<view>'),
                                '/<controller:\w+>/<action:\w+>'=>'/<controller>/<action>',
                                '/<module:\w+>/<controller:\w+>/<action:\w+>/*'=>'/<module>/<controller>/<action>',
                                
                                ),
                        ),
		
            
		/*
		'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
		*/
            
                'request'=>array(
                    'enableCookieValidation'=>true,
                    'enableCsrfValidation'=>true,
                ),
            
                // uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=fermieruldb',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'tablePrefix'=>'tbl_',
		),
            
                /*
                'db'=>array(
			'connectionString' => 'mysql:host=db11.hqhost.net;dbname=int21hi_db4',
			'emulatePrepare' => true,
			'username' => 'int21hi_db4',
			'password' => 'bpZFNz23',
			'charset' => 'utf8',
			'tablePrefix'=>'tbl_',
		),
		*/
            
		'errorHandler'=>array(
			// use 'site/error' action to display errors
                    'errorAction'=>'site/error',
                ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				/*
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				*/
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
				array(
					'class'=>'CWebLogRoute',
						//
						// I include *trace* for the 
						// sake of the example, you can include
						// more levels separated by commas
					'levels'=>'trace',
						//
						// I include *vardump* but you
						// can include more separated by commas
					'categories'=>'vardump',
						//
						// This is self-explanatory right?
					'showInFireBug'=>true
				),
			),
		),
            
                'image'=>array(
                        'class'=>'ImgManager',
                        'versions'=>array(
                                'small'=>array('width'=>100,'height'=>100),
                                'medium'=>array('width'=>320,'height'=>320),
                                'large'=>array('width'=>640,'height'=>640),
                        ),
                    ),
        ),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
        'params'=>include(dirname(__FILE__).DIRECTORY_SEPARATOR.'params.php'),
);